<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <title>Agora Custom VideoSource</title>

<body class="agora-theme">
  <div class="navbar-fixed">
    <nav class="agora-navbar">
      <div class="nav-wrapper agora-primary-bg valign-wrapper">
        <h5 class="left-align">Agora Custom VideoSource</h5>
        <a href="https://github.com/AgoraIO/Advanced-Video/tree/master/Custom-Media-Device/Agora-Custom-VideoSource-Web-Webpack" class="agora-github-pin"></a>
      </div>
    </nav>
  </div>
  <form id="form" class="row col l12 s12">
    <div class="row container col l12 s12">
      <div class="col" style="min-width: 433px; max-width: 433px;">
        <div class="card" style="margin-top: 0px; margin-bottom: 0px;">
          <div class="row card-content" style="margin-bottom: 0px;">
              <div class="input-field">
                <label for="appID" class="active">App ID</label>
                <input type="text" placeholder="App ID" name="appID">
              </div>
              <div class="input-field">
                <label for="channel" class="active">Channel</label>
                <input type="text" placeholder="channel" name="channel">
              </div>
              <div class="input-field">
                <label for="token" class="active">Token</label>
                <input type="text" placeholder="token" name="token">
              </div>
              <div class="input-field">
                <label for="stream" class="active">Stream</label>
                <select name="stream" id="stream">
                  <option value="camera">camera</option>
                  <option value="canvas">sketch-pad</option>
                  <option value="./assets/sample.mp4">sample.mp4</option>
                </select>
              </div>
              <div class="row" style="margin: 0">
                <button class="btn btn-raised btn-primary waves-effect waves-light" id="join">JOIN</button>
                <button class="btn btn-raised btn-primary waves-effect waves-light" id="leave">LEAVE</button>
                <button class="btn btn-raised btn-primary waves-effect waves-light" id="switch_track">SWITCH</button>
              </div>
              <div class="row col" style="margin: 0">
                <div class="switch">
                  <h6 style="color: rgba(0,0,0,.26);">Show Profile</h6>
                  <label>
                    <input id="show_profile" type="checkbox">
                    <span class="lever"></span>
                  </label>
                </div>
              </div>
          </div>
        </div>
        <ul class="collapsible card agora-secondary-border" style="margin-top: .4rem; border: 1px ">
          <li>
            <div class="collapsible-header agora-secondary-bg">
              <h8 class="center-align">ADVANACED SETTINGS</h8>
            </div>
            <div class="collapsible-body card-content">
              <div class="row">
                <div class="col s12">
                  <div class="input-field">
                    <label for="UID" class="active">UID</label>
                    <input type="text" placeholder="UID" name="uid">
                  </div>
                  <div class="input-field">
                    <label for="cameraId" class="active">CAMERA</label>
                    <select name="cameraId" id="cameraId"></select>
                  </div>
                  <div class="input-field">
                    <label for="microphoneId" class="active">MICROPHONE</label>
                    <select name="microphoneId" id="microphoneId"></select>
                  </div>
                  <div class="input-field">
                    <label for="cameraResolution" class="active">CAMERA RESOLUTION</label>
                    <select name="cameraResolution" id="cameraResolution"></select>
                  </div>
                  <div class="row col s12">
                    <div class="row">
                      <label for="mode" class="active">MODE</label>
                    </div>
                    <div class="row">
                      <label>
                        <input type="radio" class="with-gap" name="mode" value="live" checked />
                        <span>live</span>
                      </label>

                      <label>
                        <input type="radio" class="with-gap" name="mode" value="rtc" />
                        <span>rtc</span>
                      </label>
                    </div>
                  </div>
                  <div class="row col s12">
                    <div class="row">
                      <label for="codec" class="active">CODEC</label>
                    </div>
                    <div class="row">
                      <label>
                        <input type="radio" class="with-gap" name="codec" value="h264" checked />
                        <span>h264</span>
                      </label>

                      <label>
                        <input type="radio" class="with-gap" name="codec" value="vp8" />
                        <span>vp8</span>
                      </label>
                    </div>
                  </div>
                </div>
              </div>
          </li>
        </ul>
      </div>
      <div class="col s7">
        <div class="video-grid" id="video">
          <div class="video-view">
            <div id="local_canvas" class="video-placeholder card hide" style="margin: 0">
              <ul class="collapsible card agora-secondary-border canvas-control-bar">
                <li>
                  <div class="collapsible-body">
                    <div class="toolbar">
                      <div class="grid-item">
                        <span>WIDTH</span>
                        <div class="pointer" id="lineWidth">
                          <span class="progress mid" id="lineWidthProgress"></span>
                        </div>
                      </div>
                      <div class="grid-item">
                        <span>COLOR</span>
                        <div class="pointer" id="color">
                          <span class="progress red" id="colorProgress"></span>
                        </div>
                      </div>
                      <div>
                        <span class="pointer" id="clear">CLEAR</span>
                      </div>
                    </div>
                  </div>
                  <div class="collapsible-header">BRUSH</div>
                </li>
              </ul>
            </div>
            <div id="local_video" class="video-placeholder card hide" style="margin: 0">
              <video id="sample_video" src="./assets/sample.mp4" class="video-view" controls loop></video>
            </div>
            <div id="local_stream" class="video-placeholder card hide" style="margin: 0"></div>
            <div id="local_video_info" class="video-profile hide"></div>
            <div id="video_autoplay_local" class="autoplay-fallback hide"></div>
          </div>
        </div>
      </div>
    </div>
  </form>
    <!-- notice for developer -->
    <div id="warn" class="modal">
      <div class="modal-content">
        <div>
          Note: <br/>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ensure that you grant permissions to the media devices.<br/>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Select a video source from the drop-down list and preview it. <br/>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Click SWITCH to replace the current stream with the selected video source.<br/>
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This demo uses the replaceTrack method which supports Chrome 65+, Safari, and latest Firefox. <br/>
        </div>
      </div>
      <div class="modal-footer">
        <a id="never_show" class="modal-close waves-effect waves-green btn light-blue darken-1" id="hide_modal">DON'T SHOW AGAIN</a>
        <a id="sure" class="modal-close waves-effect waves-light btn light-blue darken-4" id="sure">SURE</a>
      </div>
    </div>
    <!-- notice for developer -->
</html>